Add new option tosupport for objectSplit for Arrays and Objects #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr adds the field objectSplit and objectSeperator.
During our use case, I noticed that the plugin formats arrays and dictionaries in a way that is not supportive of a full array or dictionary substitution.
I added objectSplit which defaults to legacy behavior of each item getting its own line
Default Behavior
objectSplit=true, objectSeperator="."
key = {"foo":[0,1,2]}
breakdown into
key.foo.0 = 0
key.foo.1 = 1
key.foo.2 = 2
New Behavior
objectSplit=false, objectSeperator="."
key = {"foo":[0,1,2]}
breakdowns into
key = {"foo":[0,1,2]}
The difference in legacy vs new behavior is how azure handles the substitution
Default Behavior replaces only what is set
New Behavior replaces the entire object
so given the example above and the following appsetting json
key = {"foo":[203],"bar":"hello"}
Default Behavior would become:
key = {"foo":[0],"bar":"hello"} as only key that matches is the 0 index of the foo array(key.foo.0)
New Behavior would replace on the "key" key and become:
key = {"foo":[0,1,2]} as key is the object is "key" and foo.bar does not exist in the "key" object.